<template>
   <a-modal
        :destroyOnClose="true"
        :visible="visible"
        :maskClosable="true"
        :width='900'
        @ok="ok"
        @cancel="cancel"
        cancelText="关闭">
       <IconSelect @change="change"></IconSelect>
   </a-modal>
</template>

<script>
import IconSelect from '@/components/IconSelector'
export default {
    name:'LiconSelect',
    components:{IconSelect},
    data(){
        return{
            visible:false,
            icon:'',
            field:'',
            form:Object
        }
    },
    methods:{
        show(field,form){
            this.field=field
            this.form=form
            this.visible=true
        },
        ok(){
            this.form.setFieldsValue({[`${this.field}`]: this.icon})
            this.visible=false
        },
        cancel(){
            this.visible=false
        },
        change(icon){
            this.icon=icon
        }
    }
}
</script>